home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / X11 / config / cygwin.rules < prev    next >
Text File  |  2006-04-12  |  14KB  |  457 lines

  1. /*
  2.  * Cygwin shared library rules (DLL versions)
  3.  */
  4.  
  5. #define HasSharedLibraries    YES
  6. #define NeedLibInsideFlag    NO
  7. #define ForceNormalLib        NO
  8. #ifndef SharedLibX11
  9. # define SharedLibX11        YES
  10. #endif
  11. #ifndef NormalLibX11
  12. # define NormalLibX11        NO
  13. #endif
  14. #define SharedLibXaw        YES
  15. #define SharedLibXmu        YES
  16. #define SharedLibXt        YES
  17. #define SharedLibFont        NO
  18. #define SharedLibXaw7        YES
  19. #define SharedLibXaw6        YES
  20. #define SharedLibSM        YES
  21. #define SharedLibICE        YES
  22. #define SharedLibXext        YES
  23. #define SharedLibXie        YES
  24. #define SharedLibXi        YES
  25. #define SharedLibPex        YES
  26. #define SharedLibXtst        YES
  27. #define SharedOldX        YES
  28. #define SharedLibXp        YES
  29. #define SharedLibGlx        YES
  30. #define SharedLibDps        YES
  31. #define SharedLibDpsTk        YES
  32. #define SharedLibGlu        YES
  33. #define SharedLibWindowsWM    NO
  34. #ifndef SharedDataSeparation
  35. #define SharedDataSeparation    NO
  36. #endif
  37.  
  38. #ifndef SharedCodeDef
  39. #define SharedCodeDef /**/
  40. #endif
  41. #ifndef SharedLibraryDef
  42. #define SharedLibraryDef /**/
  43. #endif
  44. #ifndef ShLibIncludeFile
  45. #define ShLibIncludeFile <cygwin.tmpl>
  46. #endif
  47. #ifndef SharedLibraryLoadFlags
  48. #define SharedLibraryLoadFlags -dll /**/
  49. #endif
  50. #ifndef PositionIndependentCFlags
  51. #define PositionIndependentCFlags -D_DLL
  52. #endif
  53. #ifndef PositionIndependentCplusplusFlags
  54. #define PositionIndependentCplusplusFlags -D_DLL
  55. #endif
  56. #ifndef UseExportLists
  57. #define UseExportLists YES
  58. #endif
  59.  
  60. #define SharedLibraryName(libname, rev) \
  61. Concat3(cyg,libname,-$(shell echo rev|sed s=\\..*==).dll)
  62.  
  63. #define ImportLibraryName(libname, rev) \
  64. Concat3(lib,libname,-$(shell echo rev|sed s=\\..*==).dll.a)
  65.  
  66. #define ShortImportLibraryName(libname, rev) \
  67. Concat3(lib,libname,.dll.a)
  68.  
  69. /*
  70.  * SharedDepLibraryTarget - generate rules to create a shared library.
  71.  */
  72.  
  73. #ifndef SharedDepLibraryTarget
  74. # ifdef UseInstalled
  75. #  ifndef LinkBuildSonameLibrary
  76. #   define LinkBuildSonameLibrary(lib)
  77. #  endif
  78. # else /* !UseInstalled */
  79. #  ifndef LinkBuildSonameLibrary
  80. #   define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); @@\
  81.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
  82. #  endif
  83. # endif /* UseInstalled */
  84.  
  85.  
  86. /*
  87.  * SharedDepLibraryTarget
  88.  */
  89.  
  90. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  91. AllTarget(SharedLibraryName(libname,rev))                             @@\
  92.                                     @@\
  93. SharedLibraryName(libname,rev): deplist                 @@\
  94.     RemoveFile(ImportLibraryName(libname,rev))            @@\
  95.     RemoveFile(SharedLibraryName(libname,rev))            @@\
  96.     MakeDLL(libname,solist,rev)                    @@\
  97.     LinkBuildLibrary(ImportLibraryName(libname,rev))        @@\
  98.     LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname))    @@\
  99.     LinkBuildDLL(SharedLibraryName(libname,rev))            @@\
  100.                                     @@\
  101. clean::                                    @@\
  102.     RemoveFile(ImportLibraryName(libname,rev))                @@\
  103.     RemoveFile(SharedLibraryName(libname,rev))            @@\
  104.  
  105. #endif /* SharedDepLibraryTarget */
  106.  
  107. /*
  108.  * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
  109.  */
  110.  
  111. #ifndef SharedDepCplusplusLibraryTarget
  112. # ifdef UseInstalled
  113. #  ifndef LinkBuildSonameLibrary
  114. #   define LinkBuildSonameLibrary(lib)
  115. #  endif
  116. # else /* !UseInstalled */
  117. #  ifndef LinkBuildSonameLibrary
  118. #   define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); @@\
  119.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
  120. #  endif
  121. # endif /* UseInstalled */
  122.  
  123.  
  124. /*
  125.  * SharedDepCplusplusLibraryTarget
  126.  */
  127.  
  128. #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\
  129. AllTarget(SharedLibraryName(libname,rev))                             @@\
  130.                                                                             @@\
  131. SharedLibraryName(libname,rev): deplist                    @@\
  132.     RemoveFile(ImportLibraryName(libname,rev))                      @@\
  133.     RemoveFile(SharedLibraryName(libname,rev))                      @@\
  134.     MakeCplusplusDLL(libname,solist,rev)                            @@\
  135.     LinkBuildLibrary(ImportLibraryName(libname,rev))                @@\
  136.     LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname))    @@\
  137.     LinkBuildDLL(SharedLibraryName(libname,rev))                    @@\
  138.                                                                         @@\
  139. clean::                                                                 @@\
  140.     RemoveFile(ImportLibraryName(libname,rev))                      @@\
  141.     RemoveFile(SharedLibraryName(libname,rev))                      @@\
  142.  
  143. #endif /* SharedDepCplusplusLibraryTarget */
  144.  
  145.  
  146. /*
  147.  * SharedDepModuleTarget
  148.  */
  149.  
  150. #ifndef SharedDepModuleTarget
  151. #define SharedDepModuleTarget(name,deps,solist)                @@\
  152. AllTarget(name)                                @@\
  153.                                     @@\
  154. name: deps                                @@\
  155.     $(CC) -o $@ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  156.                                     @@\
  157. clean::                                    @@\
  158.     RemoveFile(name)
  159. #endif /* SharedDepModuleTarget */
  160.  
  161.  
  162. /*
  163.  * SharedLibraryDataTarget - generate rules to create shared data file
  164.  */
  165.  
  166. #ifndef SharedLibraryDataTarget
  167. #define SharedLibraryDataTarget(libname,rev,salist)
  168. #endif
  169.  
  170.  
  171. /*
  172.  * InstallSharedLibraryData - generate rules to install the shared library data
  173.  */
  174.  
  175. #ifndef InstallSharedLibraryData
  176. #define InstallSharedLibraryData(libname,rev,dest)
  177. #endif /* InstallSharedLibraryData */
  178.  
  179. /*
  180.  * MakeDllProg
  181.  */ 
  182.     
  183. #define MakeDLLProg(libname,solist,prog,rev)                    @@\
  184.     prog -shared -Wl,--out-implib=ImportLibraryName(libname,rev) -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc -Wl,--exclude-libs,ALL -o SharedLibraryName(libname,rev) solist $(REQUIREDLIBS)
  185.     
  186. /*
  187.  * MakeDll
  188.  */
  189.  
  190. #define MakeDLL(libname,solist,rev)                    @@\
  191.     MakeDLLProg(libname,solist,$(CC),rev)
  192.  
  193. /*
  194.  * MakeCplusplusDll
  195.  */
  196.  
  197. #define MakeCplusplusDLL(libname,solist,rev)                @@\
  198.     MakeDLLProg(libname,solist,$(CXX),rev)
  199.  
  200.  
  201.  
  202. /*
  203.  * SharedLibraryTarget
  204.  */
  205.  
  206. #define SharedLibraryTarget(libname,rev,solist,down,up)                 @@\
  207. AllTarget(SharedLibraryName(libname,rev))                @@\
  208.                                                                         @@\
  209. SharedLibraryName(libname,rev): solist                    @@\
  210.     RemoveFile(ImportLibraryName(libname,rev))            @@\
  211.     RemoveFile(SharedLibraryName(libname,rev))            @@\
  212.     MakeDLL(libname,solist,rev)                    @@\
  213.     LinkBuildLibrary(ImportLibraryName(libname,rev))        @@\
  214.     LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname))    @@\
  215.     LinkBuildDLL(SharedLibraryName(libname,rev))            @@\
  216. clean::                                    @@\
  217.     RemoveFile(ImportLibraryName(libname,rev))            @@\
  218.     RemoveFile(SharedLibraryName(libname,rev))            @@\
  219.  
  220.  
  221. /*
  222.  * InstallLink
  223.  */
  224.  
  225. #ifndef InstallLink
  226. #define InstallLink(step, file, link, dest)                             @@\
  227. step::                                                                  @@\
  228.     MakeDir($(DESTDIR)dest)                                         @@\
  229.     $(LN) -sf file $(DESTDIR)dest/link
  230. #endif
  231.  
  232. /*
  233.  * InstallSharedLibrary
  234.  */
  235.  
  236. #define InstallSharedLibrary(libname,rev,dest)                          @@\
  237. InstallTarget(install,ImportLibraryName(libname,rev),$(INSTLIBFLAGS),$(USRLIBDIR)) @@\
  238. InstallTarget(install,SharedLibraryName(libname,rev),$(INSTBINFLAGS),$(BINDIR)) @@\
  239. InstallLink(install,ImportLibraryName(libname,rev),ShortImportLibraryName(libname,rev),$(USRLIBDIR))
  240.  
  241.  
  242. /*
  243.  * ProgramTargetName - This can be simply 'target' or 'target.exe' when
  244.  * building on Cygwin proper, as Cygwin automatically appends .exe to compiled
  245.  * executables and make, rm, ln, etc. will automatically search for a file
  246.  * with .exe appended if the raw file name cannot be found.  However,
  247.  * building with a cross compiler requires 'target.exe', as the cross
  248.  * compiler doesn't know to append .exe, nor do the cross compiler tools
  249.  * know to search for files with .exe appended if the raw file name cannot
  250.  * be found.
  251.  */
  252.  
  253. #define ProgramTargetName(target) Concat(target,.exe)
  254.  
  255.  
  256. /*
  257.  * HostProgramTargetName - Don't add .exe if cross-compiling.
  258.  */
  259.  
  260. #ifndef HostProgramTargetName
  261. # if CrossCompiling
  262. #  define HostProgramTargetName(target) target
  263. # else
  264. #  define HostProgramTargetName(target) ProgramTargetName(target)
  265. # endif
  266. #endif
  267.  
  268.  
  269. /*
  270.  * LinkBuildDLL - Cygwin only rule, similar to LinkBuildModule.
  271.  * Unfortunately, we have to create a copy of each DLL in xc/exports/bin;
  272.  * linking doesn't work, the executables (e.g. xkbcomp) will report
  273.  * that they cannot find DLLs (e.g. libX11.dll).
  274.  */
  275.  
  276. #ifdef UseInstalled
  277. #define LinkBuildDLL(lib) $(_NULLCMD_)
  278. #else
  279. #define LinkBuildDLL(lib) MakeDir($(BUILDBINDIR))            @@\
  280.     RemoveFile($(BUILDBINDIR)/lib)                    @@\
  281.     cd $(BUILDBINDIR) && $(CP) $(BUILDBINTOP)/$(CURRENT_DIR)/lib .
  282. #endif
  283.  
  284. #ifndef LinkImportLibrary
  285. #ifdef UseInstalled
  286. #define LinkImportLibrary(lib, importlib) $(_NULLCMD_)
  287. #else
  288. #define LinkImportLibrary(lib, importlib) MakeDir($(BUILDLIBDIR))     @@\
  289.     RemoveFile($(BUILDLIBDIR)/importlib)                            @@\
  290.     cd $(BUILDLIBDIR) && $(LN) lib importlib
  291. #endif
  292. #endif /* LinkImportLibrary */
  293.  
  294.  
  295. /*
  296.  * LinkBuildBinary - This rule normally creates a link in xc/exports/bin
  297.  * to a binary, but we create an actual copy of the binary.
  298.  * Creating a link causes the DLLs that the binary depend on, such as
  299.  * libX11.dll, not to be found.  Copying the binary causes the runtime
  300.  * directory to be xc/exports/bin, which is the location of the DLLs, thus,
  301.  * the DLLs can now be found by the binary.  Phew...
  302.  *
  303.  * Note that sometimes the binary is not an executable.  One example
  304.  * is the rgb binary file.
  305.  *
  306.  * Passing -p preserves the attributes as the date and prevents useless
  307.  * rebuilds.
  308.  *
  309.  * ProgramTargetName is passed to LinkBuildBinary if the binary
  310.  * is actually an executable; thus, we do not wrap the binary name
  311.  * with ProgramTargetName here.
  312.  */
  313.  
  314. #ifndef LinkBuildBinary
  315. #define LinkBuildBinary(binary)                        @@\
  316. all:: binary                                @@\
  317.     MakeDir($(BUILDBINDIR))                        @@\
  318.     RemoveFile($(BUILDBINDIR)/binary)                @@\
  319.     cd $(BUILDBINDIR) && $(CP) -p $(BUILDBINTOP)/$(CURRENT_DIR)/binary .
  320. #endif /* LinkBuildBinary */
  321.  
  322. /*
  323.  * ProfiledRelocatableTarget - generate rules to produce a  profiled
  324.  * relocatable object file instead of a library.  Differs from Imake.rules
  325.  * by passing '--oformat pe-i386' to ld.
  326.  */
  327.  
  328. #ifndef ProfiledRelocatableTarget
  329. #define    ProfiledRelocatableTarget(objname,objlist)            @@\
  330. AllTarget(Concat(objname,_p.Osuf))                    @@\
  331.                                     @@\
  332. Concat(objname,_p.Osuf): objlist $(EXTRALIBRARYDEPS)            @@\
  333.     RemoveFile($@)                            @@\
  334.     $(LD) -X -r --oformat pe-i386 objlist -o $@
  335.  
  336. #endif /* ProfiledRelocatableTarget */
  337.  
  338.  
  339. /*
  340.  * DebuggedRelocatableTarget - generate rules to produce a debuggable
  341.  * relocatable object file instead of a library.  Differs from Imake.rules
  342.  * by passing '--oformat pe-i386' to ld.
  343.  */
  344.  
  345. #ifndef DebuggedRelocatableTarget
  346. #define    DebuggedRelocatableTarget(objname,objlist)            @@\
  347. AllTarget(Concat(objname,_d.Osuf))                    @@\
  348.                                     @@\
  349. Concat(objname,_d.Osuf): objlist $(EXTRALIBRARYDEPS)            @@\
  350.     RemoveFile($@)                            @@\
  351.     $(LD) -X -r --oformat pe-i386 objlist -o $@
  352.  
  353. #endif /* DebuggedRelocatableTarget */
  354.  
  355.  
  356. /*
  357.  * DependDependencyStatement - Imake.rules wraps $(DEPEND) in
  358.  * ProgramTargetName(), which causes cross compiling to think that
  359.  * $(DEPEND) hasn't been built, as $(DEPEND) is a host tool, and should
  360.  * not be wrapped with ProgramTargetName().  Perhaps there should be
  361.  * a HostProgramTargetName()...
  362.  */
  363.  
  364. #ifndef DependDependencyStatement
  365. #if HasMakefileSafeInclude
  366. #define DependDependencyStatement()                    @@\
  367. DependFileName:: $(DEPEND)
  368. #else
  369. #define DependDependencyStatement()                    @@\
  370. depend:: $(DEPEND)
  371. #endif
  372. #endif
  373.  
  374.  
  375. /*
  376.  * DependDependency - Imake.rules wraps $(DEPEND) in ProgramTargetName().
  377.  * This doesn't work when cross compiling, see the locally defined
  378.  * DependDependencyStatement comment (above) for more information.
  379.  */
  380.  
  381. #ifndef DependDependency
  382. #ifdef UseInstalled
  383. #define DependDependency() /**/
  384. #else
  385. #define DependDependency()                        @@\
  386. DependDependencyStatement()                        @@\
  387.                                     @@\
  388. NoCmpScript($(DEPEND))                            @@\
  389.                                     @@\
  390. $(DEPEND):                                @@\
  391.     @echo "checking $@ over in $(DEPENDSRC) first..."; \        @@\
  392.     cd $(DEPENDSRC) && $(MAKE) makedependonly; \            @@\
  393.     echo "okay, continuing in $(CURRENT_DIR)"
  394.  
  395. #endif /* UseInstalled */
  396. #endif /* DependDependency */
  397.  
  398.  
  399. /*
  400.  * ImakeDependency - Imake.rules wraps $(IMAKE) in ProgramTargetName(),
  401.  * which doesn't work when cross compiling, as imake is supposed to be a
  402.  * host program.  See the locally defined DependDependencyStatement
  403.  * comment (above) for more information.
  404.  */
  405.  
  406. #ifndef ImakeDependency
  407. #ifdef UseInstalled
  408. #define ImakeDependency(target) /**/
  409. #else
  410. #define ImakeDependency(target)                        @@\
  411. target:: $(IMAKE)                            @@\
  412.                                     @@\
  413. NoCmpScript($(IMAKE) $(IMAKE).Osuf)                    @@\
  414.                                     @@\
  415. $(IMAKE) $(IMAKE).Osuf:                            @@\
  416.     -@(cd $(IMAKESRC) && if [ -f Makefile ]; then \            @@\
  417.     echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) imakeonly; else \    @@\
  418.     echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \    @@\
  419.     $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; fi; \    @@\
  420.     echo "okay, continuing in $(CURRENT_DIR)")
  421. #endif /* UseInstalled */
  422. #endif /* ImakeDependency */
  423.  
  424.  
  425. /*
  426.  * ResourceObjectRule - Build a Windows resouce file (.res) into
  427.  * an object file (.o) that can be linked in with the executable
  428.  * or library being built.
  429.  */
  430.  
  431. #ifndef ResourceObjectRule
  432. #define ResourceObjectRule(basename,depends,options)            @@\
  433. AllTarget(basename.RESsuf)                        @@\
  434. basename.RESsuf: basename.RCsuf depends                    @@\
  435.     RemoveFile($@)                            @@\
  436.     ClearmakeOSName \                        @@\
  437.     WindresCmd basename.RCsuf options -O coff -o basename.RESsuf    @@\
  438. clean::                                    @@\
  439.     RemoveFiles(basename.RESsuf)
  440.  
  441. #endif /* ResourceObjectRule */
  442.  
  443. /* The arglist can get quite long. Make sure we can delete it though */
  444. #ifndef MakeFonts
  445. # define MakeFonts()                            @@\
  446. all::  $(OBJS)                                @@\
  447.                                     @@\
  448. MakeFontsDir($(OBJS))                            @@\
  449.                                     @@\
  450. clean::                                    @@\
  451.     find -name "*.pcf" -o -name "*.pcf.Z" -o -name "*.pcf.gz" | xargs -r rm
  452. #endif /* MakeFonts */
  453.  
  454. #ifndef IncludeMakefile
  455. #define IncludeMakefile(file) @@sinclude file
  456. #endif
  457.